//
//  UIImage+Coolor.m
//  jtw_iOS
//
//  Created by zhangzhenyun on 2018/03/06.
//  Copyright © 2018年 user1. All rights reserved.
//

#import "UIImage+Coolor.h"

@implementation UIImage (Coolor)
+ (UIImage *)imageWithColor:(UIColor *)color withSize:(CGSize)size {
    UIGraphicsBeginImageContextWithOptions(size, 0, [UIScreen mainScreen].scale);
    [color set];
    UIRectFill((CGRect){CGPointZero, size.width, size.height});
    UIImage *pressedColorImg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return pressedColorImg;
    
}
@end
